var baseUrl ="http://192.168.3.8:3000/"
function http({url,data}){
    return  new Promise((resolve,reject)=>{
         wx.request({
            url: baseUrl+url,
            data,
            header: {'content-type':'application/json'},
            method: 'GET',
            dataType: 'json',
            responseType: 'text',
            success: (res)=>{
                resolve(res)
            },
            fail: (err)=>{
                reject(err)
            },
        });
    })
}
module.exports = {
    getSearch(keywords){
        return http({url:"search",data:{
            keywords,
        }})
    },
    getDetail(id){
        return http({
            url:'song/detail',
            data:{
                ids:id
            }
        })
    }
}